<route lang="json5" type="home"></route>

<script setup lang="ts">
import ViewContainer from "@/layouts/ViewContainer.vue";
import UserInfo from "./_components/UserInfo.vue";
import NotLogin from "./_components/NotLogin.vue";
import Domain from "./_components/Domain.vue";
import titleConfig from "./index.title";
import { getAccessToken } from "@/utils/auth";

const isLogined = computed(() => {
	const token = getAccessToken();
	return token ? true : false;
});

onLoad(() => {
	uni.hideTabBar();
});
</script>

<template>
	<ViewContainer :title="titleConfig" innerClass="home-page">
		<template v-if="isLogined">
			<UserInfo />
			<Domain />
		</template>
		<template v-else>
			<NotLogin />
		</template>
	</ViewContainer>
</template>
